/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Ex6_ex3;

/**
 *
 * @author Root
 */
public class Account {

    protected double balance;

    public Account() {
    }

    public Account(double balance) {
        this.balance = balance;

    }

    public double getBalance() {
        return balance;

    }

    public boolean Deposit(double amt) {
        if (amt < 0) {
            return false;
        } else {
            balance+=amt;
            return true;
        }

    }

    public boolean withdraw(double amt) {
        if (amt > balance) {
            return false;
        } else {
            balance-=amt;
            return true;
        }

    }

    @Override
    public String toString() {
        return "has a balance of " + balance;
    }

}
